package com.sun.hunk.util;

import com.sun.hunk.properties.LogiwareProperties;
import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author sunil
 */
public class ServerUtil {

    public static String getFullContextPath(HttpServletRequest request) {
        StringBuilder buffer = new StringBuilder("http://").append(request.getServerName()).append(":").append(request.getServerPort()).append(request.getContextPath());
        return buffer.toString();
    }

    public static String getLocalPath(HttpServletRequest request) {
        StringBuilder buffer = new StringBuilder(LogiwareProperties.getProperty("report_url")).append(request.getContextPath());
        return buffer.toString();
    }
}
